#include<stdio.h>

//结构体数组

struct Student{
  char *name;
  int age;
};

void printStuArr(struct Student stu[], int len){
    for(int i=0; i<len; i++){
        printf("[%d]name:%s, age:%d\n", i, stu[i].name, stu[i].age);
    }
}

int main(){
    //A 数组初始化方法
    struct Student stu[3]={
        {"Tom", 15},
        {"Jim", 20},
        {"Lily", 18}
    };
    printStuArr(stu, 3);
    printf("\n");

    //B 也可以不带数字
    struct Student stu2[]={
        {"Tom2", 15},
        {"Jim2", 20}
    };
    printStuArr(stu2, 2);

    return 0;
}
